file chooser: Don't react to entry changes in select-folder mode
authorMatthias Clasen <mclasen@redhat.com>
Sat, 22 Mar 2014 02:06:24 +0000 (22:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 22 Mar 2014 02:08:50 +0000 (22:08 -0400)
In select-folder mode, we are putting the directory name into the
entry ourselves. Then the entry appends a /. If we react to this
'spontaneous' change of the entry by clearing the list selection,
this will in turn make us clear the entry. We don't want that.

https://bugzilla.gnome.org/show_bug.cgi?id=726855

gtk/gtkfilechooserwidget.c

index 114627802e56c6a424c022e08cf45796604aca84..173f7f8bc30d5fb4649fcf58c9c1fc73cbafab38 100644 (file)
@@ -1920,10 +1920,11 @@ reset_location_timeout (GtkFileChooserWidget *impl)
 }
 
 static void
-location_entry_changed_cb (GtkEditable *editable,
+location_entry_changed_cb (GtkEditable          *editable,
                            GtkFileChooserWidget *impl)
 {
-  reset_location_timeout (impl);
+  if (impl->priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+    reset_location_timeout (impl);
 }
 
 static void